﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Validation;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common;
using BaMusaSoft.RPS.DataModel;



namespace BaMusaSoft.RPS.RPSServices
{
    public sealed class DomainValidator
    {
        public static ValidationResults Validate<T>(T entity)
        {
            ValidatorFactory fac = EnterpriseLibraryContainer.Current.GetInstance<ValidatorFactory>();
            Validator<T> f = fac.CreateValidator<T>();
            var res = f.Validate(entity);
            return res;
        }
        
    }
}
